
insert into table itcast_dws.itcast_intention_dws partition (yearinfo,monthinfo,dayinfo) 
SELECT
	COUNT(DISTINCT customer_id) AS customer_total,
	'-1' AS area,
	'-1' AS itcast_school_id,
	'-1' AS itcast_school_name,
	'-1' AS origin_type,
	'-1' AS itcast_subject_id,
	'-1' AS itcast_subject_name,
	'-1' AS hourinfo,
	origin_type_stat,
	clue_state_stat,
	'-1' AS tdepart_id,
	'-1' AS tdepart_name,
	yearinfo AS time_str,
	'1' AS grouptype,
	'5' AS time_type,
	yearinfo,
	'-1' AS monthinfo,
	'-1' AS dayinfo
FROM itcast_dwm.itcast_intention_dwm
GROUP BY yearinfo,origin_type_stat,clue_state_stat;


insert into table itcast_dws.itcast_intention_dws partition (yearinfo,monthinfo,dayinfo) 
SELECT
	COUNT(DISTINCT customer_id) AS customer_total,
	'-1' AS area,
	'-1' AS itcast_school_id,
	'-1' AS itcast_school_name,
	'-1' AS origin_type,
	'-1' AS itcast_subject_id,
	'-1' AS itcast_subject_name,
	'-1' AS hourinfo,
	origin_type_stat,
	clue_state_stat,
	'-1' AS tdepart_id,
	'-1' AS tdepart_name,
	CONCAT(yearinfo, '-', monthinfo) AS time_str,
	'1' AS grouptype,
	'4' AS time_type,
	yearinfo,
	monthinfo,
	'-1' AS dayinfo
FROM itcast_dwm.itcast_intention_dwm
GROUP BY yearinfo,monthinfo,origin_type_stat,clue_state_stat;


insert into table itcast_dws.itcast_intention_dws partition (yearinfo,monthinfo,dayinfo) 
SELECT
	COUNT(DISTINCT customer_id) AS customer_total,
	'-1' AS area,
	'-1' AS itcast_school_id,
	'-1' AS itcast_school_name,
	'-1' AS origin_type,
	'-1' AS itcast_subject_id,
	'-1' AS itcast_subject_name,
	'-1' AS hourinfo,
	origin_type_stat,
	clue_state_stat,
	'-1' AS tdepart_id,
	'-1' AS tdepart_name,
	CONCAT(yearinfo, '-', monthinfo, '-', dayinfo) AS time_str,
	'1' AS grouptype,
	'2' AS time_type,
	yearinfo,
	monthinfo,
	dayinfo
FROM itcast_dwm.itcast_intention_dwm
GROUP BY yearinfo,monthinfo,dayinfo,origin_type_stat,clue_state_stat;


insert into table itcast_dws.itcast_intention_dws partition (yearinfo,monthinfo,dayinfo) 
SELECT
	COUNT(DISTINCT customer_id) AS customer_total,
	'-1' AS area,
	'-1' AS itcast_school_id,
	'-1' AS itcast_school_name,
	'-1' AS origin_type,
	'-1' AS itcast_subject_id,
	'-1' AS itcast_subject_name,
	hourinfo,
	origin_type_stat,
	clue_state_stat,
	'-1' AS tdepart_id,
	'-1' AS tdepart_name,
	CONCAT(yearinfo, '-', monthinfo, '-', dayinfo, ' ', hourinfo) AS time_str,
	'1' AS grouptype,
	'1' AS time_type,
	yearinfo,
	monthinfo,
	dayinfo
FROM itcast_dwm.itcast_intention_dwm
GROUP BY yearinfo,monthinfo,dayinfo,hourinfo,origin_type_stat,clue_state_stat;









insert into table itcast_dws.itcast_intention_dws partition (yearinfo,monthinfo,dayinfo) 
SELECT
	COUNT(DISTINCT customer_id) AS customer_total,
	area,
	'-1' AS itcast_school_id,
	'-1' AS itcast_school_name,
	'-1' AS origin_type,
	'-1' AS itcast_subject_id,
	'-1' AS itcast_subject_name,
	'-1' AS hourinfo,
	origin_type_stat,
	clue_state_stat,
	'-1' AS tdepart_id,
	'-1' AS tdepart_name,
	yearinfo AS time_str,
	'2' AS grouptype,
	'5' AS time_type,
	yearinfo,
	'-1' AS monthinfo,
	'-1' AS dayinfo
FROM itcast_dwm.itcast_intention_dwm
GROUP BY yearinfo,origin_type_stat,clue_state_stat,area;


insert into table itcast_dws.itcast_intention_dws partition (yearinfo,monthinfo,dayinfo) 
SELECT
	COUNT(DISTINCT customer_id) AS customer_total,
	area,
	'-1' AS itcast_school_id,
	'-1' AS itcast_school_name,
	'-1' AS origin_type,
	'-1' AS itcast_subject_id,
	'-1' AS itcast_subject_name,
	'-1' AS hourinfo,
	origin_type_stat,
	clue_state_stat,
	'-1' AS tdepart_id,
	'-1' AS tdepart_name,
	CONCAT(yearinfo, '-', monthinfo) AS time_str,
	'2' AS grouptype,
	'4' AS time_type,
	yearinfo,
	monthinfo,
	'-1' AS dayinfo
FROM itcast_dwm.itcast_intention_dwm
GROUP BY yearinfo,monthinfo,origin_type_stat,clue_state_stat,area;


insert into table itcast_dws.itcast_intention_dws partition (yearinfo,monthinfo,dayinfo) 
SELECT
	COUNT(DISTINCT customer_id) AS customer_total,
	area,
	'-1' AS itcast_school_id,
	'-1' AS itcast_school_name,
	'-1' AS origin_type,
	'-1' AS itcast_subject_id,
	'-1' AS itcast_subject_name,
	'-1' AS hourinfo,
	origin_type_stat,
	clue_state_stat,
	'-1' AS tdepart_id,
	'-1' AS tdepart_name,
	CONCAT(yearinfo, '-', monthinfo, '-', dayinfo) AS time_str,
	'2' AS grouptype,
	'2' AS time_type,
	yearinfo,
	monthinfo,
	dayinfo
FROM itcast_dwm.itcast_intention_dwm
GROUP BY yearinfo,monthinfo,dayinfo,origin_type_stat,clue_state_stat,area;


insert into table itcast_dws.itcast_intention_dws partition (yearinfo,monthinfo,dayinfo) 
SELECT
	COUNT(DISTINCT customer_id) AS customer_total,
	area,
	'-1' AS itcast_school_id,
	'-1' AS itcast_school_name,
	'-1' AS origin_type,
	'-1' AS itcast_subject_id,
	'-1' AS itcast_subject_name,
	hourinfo,
	origin_type_stat,
	clue_state_stat,
	'-1' AS tdepart_id,
	'-1' AS tdepart_name,
	CONCAT(yearinfo, '-', monthinfo, '-', dayinfo, ' ', hourinfo) AS time_str,
	'2' AS grouptype,
	'1' AS time_type,
	yearinfo,
	monthinfo,
	dayinfo
FROM itcast_dwm.itcast_intention_dwm
GROUP BY yearinfo,monthinfo,dayinfo,hourinfo,origin_type_stat,clue_state_stat,area;

















insert into table itcast_dws.itcast_intention_dws partition (yearinfo,monthinfo,dayinfo) 
SELECT
	COUNT(DISTINCT customer_id) AS customer_total,
	area,
	itcast_school_id,
	itcast_school_name,
	'-1' AS origin_type,
	itcast_subject_id,
	itcast_subject_name,
	'-1' AS hourinfo,
	origin_type_stat,
	clue_state_stat,
	'-1' AS tdepart_id,
	'-1' AS tdepart_name,
	yearinfo AS time_str,
	'3' AS grouptype,
	'5' AS time_type,
	yearinfo,
	'-1' AS monthinfo,
	'-1' AS dayinfo
FROM itcast_dwm.itcast_intention_dwm
GROUP BY yearinfo,origin_type_stat,clue_state_stat,itcast_school_id,itcast_school_name,itcast_subject_id,itcast_subject_name;


insert into table itcast_dws.itcast_intention_dws partition (yearinfo,monthinfo,dayinfo) 
SELECT
	COUNT(DISTINCT customer_id) AS customer_total,
	area,
	itcast_school_id,
	itcast_school_name,
	'-1' AS origin_type,
	itcast_subject_id,
	itcast_subject_name,
	'-1' AS hourinfo,
	origin_type_stat,
	clue_state_stat,
	'-1' AS tdepart_id,
	'-1' AS tdepart_name,
	CONCAT(yearinfo, '-', monthinfo) AS time_str,
	'3' AS grouptype,
	'4' AS time_type,
	yearinfo,
	monthinfo,
	'-1' AS dayinfo
FROM itcast_dwm.itcast_intention_dwm
GROUP BY yearinfo,monthinfo,origin_type_stat,clue_state_stat,itcast_school_id,itcast_school_name,itcast_subject_id,itcast_subject_name;


insert into table itcast_dws.itcast_intention_dws partition (yearinfo,monthinfo,dayinfo) 
SELECT
	COUNT(DISTINCT customer_id) AS customer_total,
	area,
	itcast_school_id,
	itcast_school_name,
	'-1' AS origin_type,
	itcast_subject_id,
	itcast_subject_name,
	'-1' AS hourinfo,
	origin_type_stat,
	clue_state_stat,
	'-1' AS tdepart_id,
	'-1' AS tdepart_name,
	CONCAT(yearinfo, '-', monthinfo, '-', dayinfo) AS time_str,
	'3' AS grouptype,
	'2' AS time_type,
	yearinfo,
	monthinfo,
	dayinfo
FROM itcast_dwm.itcast_intention_dwm
GROUP BY yearinfo,monthinfo,dayinfo,origin_type_stat,clue_state_stat,itcast_school_id,itcast_school_name,itcast_subject_id,itcast_subject_name;


insert into table itcast_dws.itcast_intention_dws partition (yearinfo,monthinfo,dayinfo) 
SELECT
	COUNT(DISTINCT customer_id) AS customer_total,
	area,
	itcast_school_id,
	itcast_school_name,
	'-1' AS origin_type,
	itcast_subject_id,
	itcast_subject_name,
	hourinfo,
	origin_type_stat,
	clue_state_stat,
	'-1' AS tdepart_id,
	'-1' AS tdepart_name,
	CONCAT(yearinfo, '-', monthinfo, '-', dayinfo, ' ', hourinfo) AS time_str,
	'3' AS grouptype,
	'1' AS time_type,
	yearinfo,
	monthinfo,
	dayinfo
FROM itcast_dwm.itcast_intention_dwm
GROUP BY yearinfo,monthinfo,dayinfo,hourinfo,origin_type_stat,clue_state_stat,itcast_school_id,itcast_school_name,itcast_subject_id,itcast_subject_name;














insert into table itcast_dws.itcast_intention_dws partition (yearinfo,monthinfo,dayinfo) 
SELECT
	COUNT(DISTINCT customer_id) AS customer_total,
	'-1' AS area,
	'-1' AS itcast_school_id,
	'-1' AS itcast_school_name,
	origin_type,
	'-1' AS itcast_subject_id,
	'-1' AS itcast_subject_name,
	'-1' AS hourinfo,
	origin_type_stat,
	clue_state_stat,
	'-1' AS tdepart_id,
	'-1' AS tdepart_name,
	yearinfo AS time_str,
	'4' AS grouptype,
	'5' AS time_type,
	yearinfo,
	'-1' AS monthinfo,
	'-1' AS dayinfo
FROM itcast_dwm.itcast_intention_dwm
GROUP BY yearinfo,origin_type_stat,clue_state_stat,origin_type;


insert into table itcast_dws.itcast_intention_dws partition (yearinfo,monthinfo,dayinfo) 
SELECT
	COUNT(DISTINCT customer_id) AS customer_total,
	'-1' AS area,
	'-1' AS itcast_school_id,
	'-1' AS itcast_school_name,
	origin_type,
	'-1' AS itcast_subject_id,
	'-1' AS itcast_subject_name,
	'-1' AS hourinfo,
	origin_type_stat,
	clue_state_stat,
	'-1' AS tdepart_id,
	'-1' AS tdepart_name,
	CONCAT(yearinfo, '-', monthinfo) AS time_str,
	'4' AS grouptype,
	'4' AS time_type,
	yearinfo,
	monthinfo,
	'-1' AS dayinfo
FROM itcast_dwm.itcast_intention_dwm
GROUP BY yearinfo,monthinfo,origin_type_stat,clue_state_stat,origin_type;


insert into table itcast_dws.itcast_intention_dws partition (yearinfo,monthinfo,dayinfo) 
SELECT
	COUNT(DISTINCT customer_id) AS customer_total,
	'-1' AS area,
	'-1' AS itcast_school_id,
	'-1' AS itcast_school_name,
	origin_type,
	'-1' AS itcast_subject_id,
	'-1' AS itcast_subject_name,
	'-1' AS hourinfo,
	origin_type_stat,
	clue_state_stat,
	'-1' AS tdepart_id,
	'-1' AS tdepart_name,
	CONCAT(yearinfo, '-', monthinfo, '-', dayinfo) AS time_str,
	'4' AS grouptype,
	'2' AS time_type,
	yearinfo,
	monthinfo,
	dayinfo
FROM itcast_dwm.itcast_intention_dwm
GROUP BY yearinfo,monthinfo,dayinfo,origin_type_stat,clue_state_stat,origin_type;


insert into table itcast_dws.itcast_intention_dws partition (yearinfo,monthinfo,dayinfo) 
SELECT
	COUNT(DISTINCT customer_id) AS customer_total,
	'-1' AS area,
	'-1' AS itcast_school_id,
	'-1' AS itcast_school_name,
	origin_type,
	'-1' AS itcast_subject_id,
	'-1' AS itcast_subject_name,
	hourinfo,
	origin_type_stat,
	clue_state_stat,
	'-1' AS tdepart_id,
	'-1' AS tdepart_name,
	CONCAT(yearinfo, '-', monthinfo, '-', dayinfo, ' ', hourinfo) AS time_str,
	'4' AS grouptype,
	'1' AS time_type,
	yearinfo,
	monthinfo,
	dayinfo
FROM itcast_dwm.itcast_intention_dwm
GROUP BY yearinfo,monthinfo,dayinfo,hourinfo,origin_type_stat,clue_state_stat,origin_type;










insert into table itcast_dws.itcast_intention_dws partition (yearinfo,monthinfo,dayinfo) 
SELECT
	COUNT(DISTINCT customer_id) AS customer_total,
	'-1' AS area,
	'-1' AS itcast_school_id,
	'-1' AS itcast_school_name,
	'-1' AS origin_type,
	'-1' AS itcast_subject_id,
	'-1' AS itcast_subject_name,
	'-1' AS hourinfo,
	origin_type_stat,
	clue_state_stat,
	tdepart_id,
	tdepart_name,
	yearinfo AS time_str,
	'5' AS grouptype,
	'5' AS time_type,
	yearinfo,
	'-1' AS monthinfo,
	'-1' AS dayinfo
FROM itcast_dwm.itcast_intention_dwm
GROUP BY yearinfo,origin_type_stat,clue_state_stat,tdepart_id,tdepart_name;


insert into table itcast_dws.itcast_intention_dws partition (yearinfo,monthinfo,dayinfo) 
SELECT
	COUNT(DISTINCT customer_id) AS customer_total,
	'-1' AS area,
	'-1' AS itcast_school_id,
	'-1' AS itcast_school_name,
	'-1' AS origin_type,
	'-1' AS itcast_subject_id,
	'-1' AS itcast_subject_name,
	'-1' AS hourinfo,
	origin_type_stat,
	clue_state_stat,
	tdepart_id,
	tdepart_name,
	CONCAT(yearinfo, '-', monthinfo) AS time_str,
	'5' AS grouptype,
	'4' AS time_type,
	yearinfo,
	monthinfo,
	'-1' AS dayinfo
FROM itcast_dwm.itcast_intention_dwm
GROUP BY yearinfo,monthinfo,origin_type_stat,clue_state_stat,tdepart_id,tdepart_name;


insert into table itcast_dws.itcast_intention_dws partition (yearinfo,monthinfo,dayinfo) 
SELECT
	COUNT(DISTINCT customer_id) AS customer_total,
	'-1' AS area,
	'-1' AS itcast_school_id,
	'-1' AS itcast_school_name,
	'-1' AS origin_type,
	'-1' AS itcast_subject_id,
	'-1' AS itcast_subject_name,
	'-1' AS hourinfo,
	origin_type_stat,
	clue_state_stat,
	tdepart_id,
	tdepart_name,
	CONCAT(yearinfo, '-', monthinfo, '-', dayinfo) AS time_str,
	'5' AS grouptype,
	'2' AS time_type,
	yearinfo,
	monthinfo,
	dayinfo
FROM itcast_dwm.itcast_intention_dwm
GROUP BY yearinfo,monthinfo,dayinfo,origin_type_stat,clue_state_stat,tdepart_id,tdepart_name;


insert into table itcast_dws.itcast_intention_dws partition (yearinfo,monthinfo,dayinfo) 
SELECT
	COUNT(DISTINCT customer_id) AS customer_total,
	'-1' AS area,
	'-1' AS itcast_school_id,
	'-1' AS itcast_school_name,
	'-1' AS origin_type,
	'-1' AS itcast_subject_id,
	'-1' AS itcast_subject_name,
	hourinfo,
	origin_type_stat,
	clue_state_stat,
	tdepart_id,
	tdepart_name,
	CONCAT(yearinfo, '-', monthinfo, '-', dayinfo, ' ', hourinfo) AS time_str,
	'5' AS grouptype,
	'1' AS time_type,
	yearinfo,
	monthinfo,
	dayinfo
FROM itcast_dwm.itcast_intention_dwm
GROUP BY yearinfo,monthinfo,dayinfo,hourinfo,origin_type_stat,clue_state_stat,tdepart_id,tdepart_name;

